//
//  NavigationController.swift
//  fruit-helper-swift
//
//  Created by 赵隆杰 on 2022/6/11.
//

import UIKit

class NavigationController: UINavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()

        navigationBar.tintColor = .white
        navigationBar.prefersLargeTitles = true
        
        let appearance = UINavigationBarAppearance.init()
        appearance.backgroundColor = kThemeColor
        appearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
        appearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
        navigationBar.standardAppearance = appearance
        navigationBar.scrollEdgeAppearance = appearance
        
    }
    
    public func pushViewController(_ viewController: BaseViewController, animated: Bool) {
        pushViewController(viewController, animated: animated)
    }
    
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        viewController.hidesBottomBarWhenPushed = (viewControllers.count > 0)
        super.pushViewController(viewController, animated: animated)
    }
    
    

}
